<template>
  <div id="auctionWithdraw">
    <c-title :hide="false" :text="`保证金${fun.initWithdrawal()}`"> </c-title>
    <div class="withdrawal_complete">
      <div class="elementsin">
        <div class="elementsin_top">
          <span class="elementsin_top_txt">可{{ fun.initWithdrawal() }}金额</span>
          <div class="elementsin_top_money">
            <span class="amount_type">{{ $i18n.t("money") }}</span>
            <span class="amount">{{ Data.amount }}</span>
          </div>
        </div>
        <van-sticky :offset-top="40" @change="stickChange">
          <div class="elementsin_bottom" v-if="checkList.length > 0" @click="getWithdrawType" :style="{ 'background-color': stickStatus ? 'rgb(250, 138, 77,1)' : '' }">
            <template v-if="pay_type == 'balance'">
              <i class="iconfont iconfont icon-fontclass-fanli" v-if="pay_type"></i>
            </template>
            <template v-else>
              <i class="iconfont" v-if="pay_type" :class="pay_type == 'wechat' ? 'iconfont icon-card_weixin' : 'iconfont icon-all_alipay'"></i>
            </template>
            <div class="elementsin_bottom_text" v-if="pay_type == 'balance'">
              <span class="elementsin_bottom_text_top">{{ fun.initWithdrawal() }}到{{balance_name}}</span>
              <span>通过审核后将打款到系统{{balance_name}}！</span>
            </div>
            <div class="elementsin_bottom_text" v-if="pay_type == 'wechat' || pay_type == 'alipay'">
              <span class="elementsin_bottom_text_top">{{ pay_type == 'wechat'?`${fun.initWithdrawal()}到微信`:`${fun.initWithdrawal()}到支付宝` }} </span>
              <span>通过审核后将打款到个人{{ pay_type == 'wechat'?'微信零钱':'支付宝' }}</span>
            </div>
            <div v-if="!pay_type" class="elementsin_bottom_text">
              <span>请选择{{ fun.initWithdrawal() }}方式</span>
            </div>
            <i class="iconfont icon-advertise-next"></i>
          </div>
        </van-sticky>
      </div>
    </div>
    <div class="mtype">
      <div class="mtype_left">选择保证金</div>
      <div class="mtype_right">
        全选
        <van-checkbox
          style="opacity: 0; position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
          checked-color="#f15353"
          @change="allSelect"
          v-model="checkAll"
          :checked="checkAll"
        >
        </van-checkbox>
      </div>
    </div>
    <div class="mtypeList">
      <van-checkbox-group @change="allSelectHandle" v-model="checkList" ref="checkboxGroup">
        <template v-for="(item, index) in datasource">
          <div class="mtlis" :key="index">
            <div class="mtlis_left">
              <div class="mtlis_left_top">{{ item.goods ? item.goods.title : `保证金${fun.initWithdrawal()}` }}</div>
            </div>
            <div class="mtlis_conten">
              <div class="price">
                {{ $i18n.t("money") }}<span>{{ item.money }}</span>
              </div>
            </div>
            <van-checkbox shape="square" checked-color="#f96d20" :key="item" :name="item"></van-checkbox>
          </div>
        </template>
      </van-checkbox-group>
    </div>

    <div class="confirm">
      <span>合计</span>
      <div class="confirm_conten">
        <div class="total">
          <span class="no">{{ $i18n.t("money") }}</span
          >{{countTotal}}
        </div>
      </div>
      <div class="confirmBtn" @click="getMergeServicetax">
        {{ fun.initWithdrawal() }}
        <yzSubscribe v-on:confirm="confirmSub" v-on:error="errorSub" :tagName="'withdraw'" :styleWidth="'300px'" :styleHeight="'100px'" :couponHeight="'100px'" :styleSubWidth="'300px'"></yzSubscribe>
      </div>
    </div>
    <!-- 微信 -->
    <div class="withdrawal_box_list" v-if="isWechat">
      <i class="iconfont icon-card_weixin"></i>
      <div class="withdrawal_box_list_wrap">
        <span class="txt">微信</span>
        <span class="txtTwo">通过审核后将打款到个人微信零钱！</span>
      </div>
      <div class="withdrawal_box_list_check">
        <van-radio checked-color="#f96d20" name="wechat"></van-radio>
      </div>
    </div>
    <!-- 支付宝 -->
    <div class="withdrawal_box_list" v-if="isAlipay">
      <i class="iconfont icon-all_alipay"></i>
      <div class="withdrawal_box_list_wrap">
        <span class="txt">支付宝</span>
        <span class="txtTwo">通过审核后将打款到个人支付宝！</span>
      </div>
      <div class="withdrawal_box_list_check">
        <van-radio checked-color="#f96d20" name="alipay"></van-radio>
      </div>
    </div>
    <!-- 提现方式弹窗 -->
    <van-popup v-model="show1" position="bottom" :style="{ height: '60%' }">
      <div class="withdrawal_box_no">
        <h2>选择{{ fun.initWithdrawal() }}方式<i class="iconfont icon-close11" @click="show1 = false"></i></h2>
        <van-radio-group v-model="pay_type" @change="SelectHandle">
          <div class="withdrawal_box_listBox" v-if="Data">
            <!-- 余额 -->
            <div class="withdrawal_box_list" v-if="Data.balance">
              <i class="iconfont icon-fontclass-fanli"></i>
              <div class="withdrawal_box_list_wrap">
                <span class="txt">{{balance_name}}</span> 
                <span class="txtTwo">通过审核后将打款到系统{{balance_name}}！</span>
              </div>
              <div class="withdrawal_box_list_check">
                <van-radio checked-color="#f96d20" name="balance"></van-radio>
              </div>
            </div>
            <!-- 微信 -->
            <div class="withdrawal_box_list" v-if="Data.wechat">
              <i class="iconfont icon-card_weixin"></i>
              <div class="withdrawal_box_list_wrap">
                <span class="txt">微信</span>
                <span class="txtTwo">通过审核后将打款到个人微信零钱！</span>
              </div>
              <div class="withdrawal_box_list_check">
                <van-radio checked-color="#f96d20" name="wechat"></van-radio>
              </div>
            </div>
            <!-- 支付宝 -->
            <div class="withdrawal_box_list" v-if="Data.alipay">
              <i class="iconfont icon-all_alipay"></i>
              <div class="withdrawal_box_list_wrap">
                <span class="txt">支付宝</span>
                <span class="txtTwo">通过审核后将打款到个人支付宝！</span>
              </div>
              <div class="withdrawal_box_list_check">
                <van-radio checked-color="#f96d20" name="alipay"></van-radio>
              </div>
            </div>
          </div>
        </van-radio-group>
      </div>
    </van-popup>
  </div>
</template>
<script>
import auctionWithdraw_controller from "./auctionWithdraw_controller";

export default auctionWithdraw_controller;
</script>
<style lang="scss" scoped>
#auctionWithdraw {
  padding-bottom: 80px;

  .confirm {
    width: 23.44rem;
    height: 3.44rem;
    background-color: #fff;
    box-shadow: 0 -0.12rem 0.28rem 0 rgba(205, 205, 205, 0.4);
    position: fixed;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 0.94rem;
    align-items: center;
    box-sizing: border-box;

    .confirm_conten {
      flex: 1;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      margin-left: 0.53rem;

      .total {
        font-size: 1rem;
        color: #f96d20;

        .no {
          font-size: 0.75rem;
        }
      }

      .btxt {
        font-size: 0.69rem;
        color: #747474;
        text-align: left;
      }
    }

    .confirmBtn {
      width: 5.63rem;
      height: 2.5rem;
      background-color: #f96d20;
      border-radius: 1.25rem;
      font-size: 0.94rem;
      color: #fff;
      text-align: center;
      line-height: 2.5rem;
    }
  }

  .mtypeList {
    .mtlis {
      display: flex;
      align-items: center;
      padding-left: 1rem;
      padding-right: 0.94rem;
      height: 3.75rem;
      background: #fff;

      .mtlis_left {
        height: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        .mtlis_left_bottom {
          font-size: 0.69rem;
          color: #858585;
          margin-top: 0.53rem;
        }
      }

      .mtlis_conten {
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        margin-right: 1.38rem;

        .price {
          font-size: 0.94rem;
          color: #f96d20;
          width: 100%;
          text-align: left;

          .no {
            font-size: 0.75rem;
          }
        }

        .poundagetype {
          color: #a3a3a3;
          font-size: 0.75rem;
          margin-top: 0.31rem;
        }
      }
    }
  }

  .mtype {
    display: flex;
    align-items: center;
    height: 2.69rem;
    justify-content: space-between;
    padding: 0 0.94rem;
    box-sizing: border-box;

    .mtype_left {
      font-size: 1rem;
      color: #f96d20;
    }

    .mtype_right {
      width: 3.13rem;
      height: 1.44rem;
      background-color: #f96d20;
      border-radius: 0.19rem;
      font-size: 0.75rem;
      line-height: 1.44rem;
      display: flex;
      justify-content: center;
      color: #fff;
      position: relative;
    }
  }

  .withdrawal_complete {
    padding: 0.91rem 0.91rem 1.09rem 0.97rem;
    box-sizing: border-box;
    background: #fff;

    .elementsin {
      width: 21.56rem;
      min-height: 9.06rem;
      background-image: linear-gradient(-50deg, #f96d20 0%, #fcab4f 100%);
      box-shadow: 0 0.31rem 0.47rem 0 rgba(250, 128, 46, 0.2);
      border-radius: 0.75rem;
      display: flex;
      flex-direction: column;

      .elementsin_bottom {
        min-height: 2.91rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.41rem 1rem;
        background-color: rgba(255, 255, 255, 0.2);
        box-sizing: border-box;
        color: #fff;

        .iconfont {
          font-size: 1.3rem;
        }

        .elementsin_bottom_text {
          flex: 1;
          display: flex;
          flex-direction: column;
          margin-left: 0.53rem;

          .elementsin_bottom_text_top {
            font-size: 0.88rem;
          }

          span {
            text-align: left;
            font-size: 0.75rem;
          }
        }
      }

      .elementsin_top {
        flex: 1;
        padding-top: 1.41rem;
        padding-left: 2.25rem;
        display: flex;
        flex-direction: column;

        .elementsin_top_txt {
          font-size: 0.81rem;
          color: #fff;
          text-align: left;
        }

        .elementsin_top_money {
          display: flex;
          font-size: 1.69rem;
          color: #fff;

          .amount_type {
            line-height: 2.7rem;
            font-size: 0.94rem;
          }
        }
      }
    }
  }
}
// 提现方法
.withdrawal_box_no {
  h2 {
    background: #fff;
    line-height: 2.875rem;
    font-size: 16px;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1;
    // border-bottom: solid 0.0625rem #ebebeb;

    .icon-close11 {
      width: 3rem;
      display: inline-block;
      position: absolute;
      right: 0;
      font-size: 1rem;
      color: #666;
    }
  }

  .withdrawal_box_listBox {
    // overflow-y: auto;
  }

  .withdrawal_box_list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.97rem 1rem 1.13rem;
    box-sizing: border-box;

    .iconfont {
      color: #f96d20;
      font-size: 1.5rem;
    }

    .withdrawal_box_list_wrap {
      flex: 1;
      margin-left: 0.75rem;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      font-size: 0.81rem;

      .txt {
        font-size: 0.94rem;
        font-weight: 600;
      }

      .txtTwo {
        margin-top: 0.66rem;
      }

      .userTxt {
        display: flex;
        align-items: center;
      }

      .modify {
        margin-left: 0.91rem;
        color: #ee3131;
      }
    }

    .withdrawal_box_list_check {
      position: relative;
    }
  }
}
// 提现到银行卡
.bandBox {
  .bandSave {
    width: 20rem;
    height: 2.5rem;
    background-color: #f96d20;
    border-radius: 1.25rem;
    font-size: 0.94rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    margin-top: 2rem;
  }

  .rule {
    display: flex;
    align-items: center;
    padding: 0 0.94rem;
    margin-bottom: 1.38rem;

    .ruleLeftDist {
      display: flex;
      align-items: center;
      font-size: 0.94rem;
    }

    .rightDist {
      height: 22px;
      flex: 1;
      display: flex;
      justify-content: flex-end;
      font-size: 0.94rem;
      align-items: center;

      span {
        margin-right: 0.39rem;
      }

      i {
        margin-top: 3px;
      }
    }

    .ruleRighe {
      flex: 1;

      ::-webkit-input-placeholder {
        /* placeholder字体大小 */
        font-size: 0.94rem;
      }

      .van-cell {
        padding-top: 0;
        padding-bottom: 0;
      }
    }

    .ruleLeft {
      display: flex;
      align-items: center;
      font-size: 0.94rem;
      margin-top: -5px;
    }
  }

  h2 {
    margin-bottom: 2rem;
    background: #fff;
    line-height: 2.875rem;
    font-size: 16px;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1;
    // border-bottom: solid 0.0625rem #ebebeb;

    .icon-close11 {
      width: 3rem;
      display: inline-block;
      position: absolute;
      right: 0;
      font-size: 1rem;
      color: #666;
    }
  }
}

.withdrawal_box {
  h2 {
    background: #fff;
    line-height: 2.875rem;
    font-size: 16px;
    border-bottom: solid 0.0625rem #ebebeb;
    z-index: 10;

    .icon-close11 {
      width: 3rem;
      display: inline-block;
      position: absolute;
      right: 0;
      font-size: 1rem;
      color: #666;
    }
  }

  .deduction_value {
    text-align: left;
    margin-left: 1.25rem;
  }

  .recharge_way {
    background: #fff;

    li {
      position: relative;
      display: flex;
      align-items: center;
      line-height: 2rem;
      font-size: 14px;
      margin: 0.5rem 0.5rem 0.5rem 1.25rem;
      padding-right: 1.25rem;

      /* border-bottom: solid 0.0625rem #ebebeb; */
      span {
        font-size: 13px;
        color: #8c8c8c;
      }

      .iconfont_bg {
        background: #f15353;
        width: 2.25rem;
        height: 1.5rem;
        border-radius: 0.1875rem;
        display: flex;
        align-items: center;
        margin-right: 0.625rem;
      }

      .icon-balance_d {
        color: #00908c;
      }

      .icon-balance_e {
        color: #64b42e;
      }

      .icon-balance_f {
        color: #fac337;
      }

      .icon-balance_g {
        color: #00508e;
      }

      .icon-balance_h {
        color: #fac337;
      }

      .icon-balance_i {
        color: #64b42e;
      }

      .icon-balance_j {
        color: #069ce7;
      }

      .icon-balance_z {
        background-image: url(../../../assets/images/pay_e.png);
      }

      .iconfont {
        font-size: 2rem;
        margin-right: 0.625rem;
      }
    }
  }

  .btn {
    width: 21.5625rem;
    margin: 1.25rem auto;
    height: 2.875rem;
    border-radius: 2rem;
    font-size: 16px;
    color: #fff;
    background: #f15353;
    border: none;
  }
}
// 客服
.pop-content {
  width: 100%;
  padding: 3.1875rem 0;
  text-align: center;
  border-radius: 1.1875rem;
  background: #fff;

  .pop-top {
    display: flex;
    align-items: unset;
    justify-content: center;

    .left {
      width: 50%;
      display: flex;
      justify-content: center;

      .wrap {
        display: flex;
        flex-direction: column;
        align-items: center;

        .image {
          width: 2.625rem;
          height: 2.625rem;
          margin-bottom: 0.5rem;

          img {
            width: 100%;
            height: 100%;
          }
        }
      }
    }

    .line {
      width: 1px;
      height: 1.625rem;
      background-color: #999;
    }

    .right {
      width: 50%;
      display: flex;
      justify-content: center;

      .wrap {
        display: flex;
        flex-direction: column;
        align-items: center;

        .image {
          width: 2.625rem;
          height: 2.625rem;
          margin-bottom: 0.5rem;

          img {
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }

  .pop-bottom {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;

    .image {
      width: 50%;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .icon-close11 {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 18px;
  }
}
</style>